//
//  HMMeTableViewController.swift
//  Weibo05
//
//  Created by IvesMac on 2017/6/4.
//  Copyright © 2017年 IvesMac. All rights reserved.
//

import UIKit

class HMMeTableViewController: UITableViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

//        setupNavUI()
        
        // 实现以下无限push的部分
        addPushButton()
        
    }
    
    // 添加导航栏push按钮
    private func addPushButton(){
        
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "push", target: self, action: #selector(pushAction))
    }
    
    // push按钮的点击事件
    @objc private func pushAction() {
        
        let testVc = HMTestViewController()
        
        self.navigationController?.pushViewController(testVc, animated: true)
    }
    
    
    

    //  设置导航栏按钮
    private func setupNavUI() {
        
        // 自定义视图的UIBarButtonItem构造方法
        navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", target: self, action: #selector(registerButtonAction))
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登录", target: self, action: #selector(loginButtonAction))
        
    }
    
    //  MARK:   --导航栏按钮点击事件
    @objc private func registerButtonAction() {
        
        print("注册")
        
    }
    
    @objc private func loginButtonAction() {
        print("登录")
        
    }



    
}
